package com.dubbo.demo.cunsumer.test;

import com.dubbo.demo.pojo.User;
import com.dubbo.demo.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

public class ConsumerMain {
    public static void main(String[] args) throws IOException {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("dubbo-user-consumer.xml");
        context.start();
        //获取远程服务代理对象
        UserService userService = (UserService) context.getBean("userService");
        User  user= userService.getUser(2);
        System.out.println(user.toString());
//        System.in.read();
    }
}
